var status = 0;
var 红星星 ="#fItem/Etc/0427/04270001/Icon8/5#";
var 黄星星 ="#fItem/Etc/0427/04270001/Icon9/0#";



function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (status >= 0 && mode == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
          var text = "";
		   text += "           "+红星星+" #b欢迎来到 #r宝石功能 #b功能 "+红星星+"\r\n\r\n";
		   // text += "#k#L3#"+黄星星+"宝石合成#l\r\n";
		   text += "#k#L1#"+黄星星+"宝石镶嵌#l\r\n";
		   text += "#k#L2#"+黄星星+"宝石拆卸#l\r\n";
		   text += "#k#L3#"+黄星星+"宝石合成#l\r\n";
		   cm.sendSimple(text);
        } else if (status == 1) {
			if(selection ==1){
			cm.dispose();
			cm.openNpc(9900004,11);
			}else if(selection ==2){
			cm.dispose();
			cm.openNpc(9900004,12);	
			}else if(selection ==3){
			cm.dispose();
			cm.openNpc(9900004,13);	
			}
        } 
        }
    }

